import EmailProcess.Mailer;
import EmailProcess.Cleanup;
import EmailProcess.EmailAttachment;
import EmailProcess.ExecuteExportPO;
import EmailProcess.Mailer;
import MaintMenu.ExecutePOAnalysis;
import MaintMenu.PoAnalysis.*;
import MaintMenu.SyncInventoryToCat.InsertNewItemInTblinventoryTo6Mast;
import MaintMenu.SyncInventoryToCat.UpdCapa;
import MaintMenu.SyncInventoryToCat.UpdInvPL;
import MaintMenu.SyncInventoryToCat.UpdateTblinventoryPLfrom6Cats;
import MaintMenu.VenPricingUpdMasterFiles.*;
import MaintMenu.VenPricingUpdTBLN.*;
import MaintMenu.VenPricingUpdTBLN.Trn6Category;
import MaintMenu.VendorCostPreProcess;
import MaintMenu.timerSql;
import PartsLookUp.dnkNumToPL;
import plUpdate.ExportPLwithErrors;

import javax.swing.*;

/**
 * Created with IntelliJ IDEA.
 * User: Jason
 * Date: 5/31/13
 * Time: 5:14 PM
 * To change this template use File | Settings | File Templates.
 */
public class Main {
//    static String dd="";
//    public static void main(String[] args) {
//        MainMenu mainMenu = new MainMenu();
//        mainMenu.setVisible(true);
//        mainMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);

//    public static void main(String key[]) {
//        VendorCostPreProcess vendorCostPreProcess = new VendorCostPreProcess("DP",4);
//        DEPOtbl depo11 = new DEPOtbl(0);

//        test2tbl test2tbl = new test2tbl();



//        for dos arg
//        int x=Integer.parseInt(key[0]);
//        switch(x){
//            case 1: System.out.println("Step 1");
//                MainMenu mainMenu = new MainMenu();
//                mainMenu.setVisible(true);
//                mainMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//                break;
//            case 2:


    public static void main(String [] args) {
        if (args.length == 0) {
//            System.out.println("no arg");
//            throw new IllegalArgumentException("arg required 1)Menu 2)POANewPriceOnly 3)POACarryOverPrice");
        }

        int x=Integer.parseInt(args[0]);


        switch(x){
            case 1:
                MainMenu mainMenu = new MainMenu();
                mainMenu.setVisible(true);
                mainMenu.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
                break;

            case 2:             //POA NEW PRICE ONLY
//                System.out.println(" <<<<<<<<               NEW PRICE ONLY              >>>>>>>>");
                timerSql timerSql = new timerSql();
                timerSql.setbTime();
                //System.out.print("A ");
                step0();                        //***Step 0: process Vendor Cost Update            *** Don't run this more than once in single process *** calculates cuft/pkg to single piece value.
                //System.out.print("B ");
                step1();                        //***Step 1: Updatate PL# from 6 Cats to TblInventory
                //System.out.print("C ");
                step3_6();                      //***Step 3.6: reset tblinventory CAPA based on PART# Q and not QQ
                //System.out.print("D ");
                step2();                        //***Step 2: Insert new item from tblInventory to ??MAST  (i.e.OTMAST
                //System.out.print("E ");
//                step2_5();                      //***Step 2.5: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST          ***Optional
                step3();                        //***Step 3: Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)
                //System.out.print("F ");
//                step3_5();                      //***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT
//                step3_6();                      //***Step 3.6: reset tblinventory and TBLN ,CAPA based on PART# Q and not QQ
                step4Newonly();                        //***Step 4:  Update Vendor goods information based on partslink#(Price,Part#,Package etc) to TBL??N
                //System.out.print("G ");
                step5();                        //***Step 5: POA 3D
                //System.out.print("H ");
//                step6();                        //***Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)
                step3_5();                      //***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT
                //System.out.print("I ");
                step3_6();                      //***Step 3.6: reset tblinventory and TBLN ,CAPA based on PART# Q and not QQ
                //System.out.print("J ");
                step4Newonly();                        //***Step 4:  Update Vendor goods information based on partslink#(Price,Part#,Package etc) to TBL??N
                //System.out.print("K ");
                step5();                        //***Step 5: POA 3D
                //System.out.print("L ");
                step6();                        //***Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)
                //System.out.print("M ");
                step7();                        // /Export POA and Email.
                //System.out.print("END ");
////
////
                String timeReport = "Process took :"+timerSql.gettTime();
                //System.out.println(timeReport);
                break;

            case 3:             //POA CARRY OVER PRICE
//                System.out.println(" <<<<<<<<               CARRY OVER PRICE               >>>>>>>>");
                timerSql timerSql1 = new timerSql();
                timerSql1.setbTime();
                //System.out.print("A ");
                step0();                        //***Step 0: process Vendor Cost Update            *** Don't run this more than once in single process *** calculates cuft/pkg to single piece value.
                //System.out.print("B ");
                step1();                        //***Step 1: Updatate PL# from 6 Cats to TblInventory
                //System.out.print("C ");
                step3_6();                      //***Step 3.6: reset tblinventory CAPA based on PART# Q and not QQ
                //System.out.print("D ");
                step2();                        //***Step 2: Insert new item from tblInventory to ??MAST  (i.e.OTMAST
                //System.out.print("E ");
//                step2_5();                      //***Step 2.5: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST          ***Optional
                step3();                        //***Step 3: Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)
                //System.out.print("F ");

//                step6_1();                      //Replace all CUFT for TYGTW from package to per piece.  // need to verify if it work or not!!!!

//                step3_5();                      //***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT
//                step3_6();                      //***Step 3.6: reset tblinventory and TBLN ,CAPA based on PART# Q and not QQ
                step4IncOrg();                        //***Step 4:  Update Vendor goods information based on partslink#(Price,Part#,Package etc) to TBL??N
                //System.out.print("G ");
                step5();                        //***Step 5: POA 3D
                //System.out.print("H ");
//                step6();                        //***Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)
//                step3_5();                      //***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT
                step3_6();                      //***Step 3.6: reset tblinventory and TBLN ,CAPA based on PART# Q and not QQ
                //System.out.print("I ");
                step4IncOrg();                        //***Step 4:  Update Vendor goods information based on partslink#(Price,Part#,Package etc) to TBL??N
                //System.out.print("J ");
                step5();                        //***Step 5: POA 3D
                //System.out.print("K ");
                step6();                        //***Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)
                //System.out.print("L ");
                step7();                        // /Export POA and Email.
                //System.out.print("END ");
////
////
                String timeReport1 = "Process took :"+timerSql1.gettTime();
                //System.out.println(timeReport1);
//                timerSql timerSql1 = new timerSql();
//                timerSql1.setbTime();
//
//                step0();                        //***Step 0: process Vendor Cost Update
//                step1();                        //***Step 1: Updatate PL# from 6 Cats to TblInventory
//                step2();                        //***Step 2: Insert new item from tblInventory to ??MAST  (i.e.OTMAST
////                step2_5();                      //***Step 2.5: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST
//                step3();                        //***Step 3: Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)
////                step3_5();                      //***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT                 //Exclude for CARRY OVER PRICE
//                step3_6();                      //***Step 3.6: reset tblinventory CAPA based on PART# Q and not QQ
//                step4IncOrg();                        //***Step 4: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to TBL??N
//                step5();                        //***Step 5: POA 3D
//                step6();                        //***Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)
//                step7();                        // /Export POA and Email.
//
//
//
//                String timeReport1 = "Process took :"+timerSql1.gettTime();
//                System.out.println(timeReport1);
                break;
            case 0: //Test only
                test();                        //dp


                break;

        }
    }
    public static void test(){
//        TYGcuftPkgUpdate tyGcuftPkgUpdate = new TYGcuftPkgUpdate();

//        VendorCostPreProcess vc = new VendorCostPreProcess("DP",4);   //update Vendor Cost sheet receives from mail. _costdepo1-4 adds CAPA and PARTSLINK field and isolates.
        VendorCostPreProcess vc1 = new VendorCostPreProcess("TW",6); //delete [oe#] from vendor cost / change CAPA datatype
//        VendorCostPreProcess vc2 = new VendorCostPreProcess("YCC",1); //update YCC package cuft with piece cuft
//        VendorCostPreProcess vc3 = new VendorCostPreProcess("GN",1); //update GN with -9 in part# as CAPA

//        step3_5();

//        VendorMasterCostListing vendorMasterCostListing0 = new VendorMasterCostListing("DP",4);
//        VendorMasterCostListing vendorMasterCostListing1 = new VendorMasterCostListing("TW",6);
//        VendorMasterCostListing vendorMasterCostListing2 = new VendorMasterCostListing("YCC",1);
//        VendorMasterCostListing vendorMasterCostListing3 = new VendorMasterCostListing("GN",1);
//        VendorMasterCostListing vendorMasterCostListing4 = new VendorMasterCostListing("TX",3);
//        VendorMasterCostListing vendorMasterCostListing5 = new VendorMasterCostListing("AP",1);


//        dnkNumToPL dnkNumToPL = new dnkNumToPL("CH2800149");
//        FindItemByVendorSheetPL findItemByVendorSheetPL0 = new FindItemByVendorSheetPL("TW",dnkNumToPL.getNum(),5);
//        VendorCostPreProcess vc3 = new VendorCostPreProcess("GN",1); //update GN with -9 in part# as CAPA
//        TYGtwtbl tyGtw0 = new TYGtwtbl(0);                       //tyg
//        TYGtwtbl tyGtw0 = new TYGtwtbl(0);
//
//        UpdInvPL updInvPL = new UpdInvPL();//tyg
//        InsertNewItemInTblinventoryTo6Mast insertNewItemInTblinventoryTo6Mast = new InsertNewItemInTblinventoryTo6Mast();
//
//        Trn6Category trn6Category = new Trn6Category();
//
//        delTblnCost delTblnCost = new delTblnCost();
//
//        // reset tblinventory CAPA based on PART# Q and not QQ
//        UpdCapa updCapa = new UpdCapa();
//
//
//
//        DateRange dateRange = new DateRange();
//        String f = dateRange.threeDayBack();
//        String t = dateRange.yesterday();
//        BCAnalysis bcAnalysis = new BCAnalysis(f, t);
//        VendorCostUpd  upd3a  = new VendorCostUpd("BC",1);


//        ExportPLwithErrors exportPLwithErrors = new ExportPLwithErrors();
//        UpdCapa updCapa = new UpdCapa();
//        UpdInvPL updInvPL = new UpdInvPL();
//        FindItemByVendorSheetPL findItemByVendorSheetPL1 = new FindItemByVendorSheetPL("TX","ch1000924",9);

//        YCCtbl ycc1= new YCCtbl(0);                              //ycc
//        VendorCostUpd  upd7a  = new VendorCostUpd("LTBK",1);
//        updTEMPUOUT2VenColumn updTEMPUOUT2VenColumn = new updTEMPUOUT2VenColumn("BC");
//        updTEMPUOUT2VenColumn updTEMPUOUT2VenColumn1 = new updTEMPUOUT2VenColumn("OT");
//        updTEMPUOUT2VenColumn updTEMPUOUT2VenColumn2 = new updTEMPUOUT2VenColumn("HF");
//        Mailer procPO = new Mailer();
//        VendorMasterCostListing vendorMasterCostListing = new VendorMasterCostListing("AP",1);
//        UpdateTblinventoryPLfrom6Cats updateTblinventoryPLfrom6Cats = new UpdateTblinventoryPLfrom6Cats();
//        UpdCapa updCapa = new UpdCapa();
//        step7();
//        VendorCostPreProcess vc = new VendorCostPreProcess("DP",4);   //update Vendor Cost sheet receives from mail. _costdepo1-4 adds CAPA and PARTSLINK field and isolates.
//        delTblnCost delTblnCost = new delTblnCost();
//        DEPOtbl depo11 = new DEPOtbl(0);                         //dp
    }
    public static void batchNewCostOnly(){

        timerSql timerSql = new timerSql();
        timerSql.setbTime();


        //System.out.println("***Step 0: process Vendor Cost Update");
        VendorCostPreProcess vc = new VendorCostPreProcess("DP",4);   //update Vendor Cost sheet receives from mail. _costdepo1-4 adds CAPA and PARTSLINK field and isolates.
        VendorCostPreProcess vc1 = new VendorCostPreProcess("TW",6); //delete [oe#] from vendor cost / change CAPA datatype
        VendorCostPreProcess vc2 = new VendorCostPreProcess("YCC",1); //update YCC package cuft with piece cuft
        VendorCostPreProcess vc3 = new VendorCostPreProcess("GN",1); //update GN with -9 in part# as CAPA
        //        //Updatate PL from 6 Cats to TblInventory
        //System.out.println("\n***Step 1: Updatate PL# from 6 Cats to TblInventory");
        UpdateTblinventoryPLfrom6Cats updateTblinventoryPLfrom6Cats = new UpdateTblinventoryPLfrom6Cats();
////
        //***Step 1. tblInventory to ??MAST  (i.e.OTMAST)
        //System.out.println("\n***Step 2: Insert new item from tblInventory to ??MAST  (i.e.OTMAST)\n");
        InsertNewItemInTblinventoryTo6Mast insertNewItemInTblinventoryTo6Mast = new InsertNewItemInTblinventoryTo6Mast();
////                break;
////            case 2: System.out.println("***Step 2");
//

//
        //***Step 2. Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST)
//                System.out.println("\n***Step 2.5: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST)");
//                AP ap= new AP();
//                System.out.print("AP Complete");
//                YCC ycc= new YCC();
//                System.out.print(" . YCC Complete");
//                TYGtw tyGtw = new TYGtw();
//                System.out.print(" . TW Complete");
//                TYGtx tyGtx = new TYGtx();
//                System.out.print(" . TX Complete");
//                GENERA gen = new GENERA();
//                System.out.print(" . GN Complete");
//                DEPO depo1 = new DEPO();
//                System.out.println(" . DP Complete");



        //***Step 3. Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)
        //System.out.println("\n***Step 3: Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)");
        Trn6Category trn6Category = new Trn6Category();


        //System.out.println("***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT");      //************************** DELETE PRICING BEFORE UPDATE NEW PRICING **************************
        delTblnCost delTblnCost = new delTblnCost();


        //System.out.println("***Step 3.6: reset tblinventory CAPA based on PART# Q and not QQ");
        // reset tblinventory CAPA based on PART# Q and not QQ
        UpdCapa updCapa = new UpdCapa();


        //***Step 4. Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.)  //0 = partlink ; 1 = part#
        //System.out.println("\n***Step 4: Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.");
        APtbl ap1= new APtbl(0);                                 //ap
        //System.out.print("\nAP Complete\n");                     //ap
        YCCtbl ycc1= new YCCtbl(0);                              //ycc
        //System.out.print("\nYCC Complete\n");                    //ycc
        TYGtwtbl tyGtw0 = new TYGtwtbl(0);                       //tyg
        TYGtwtbl tyGtw1 = new TYGtwtbl(1);                       //tyg  1
        //System.out.print("\nTW Complete\n");                     //tyg
        TYGtxtbl tyGtx0 = new TYGtxtbl(0);                       //tx
        TYGtxtbl tyGtx1 = new TYGtxtbl(1);                       //tx   1
        //System.out.print("\nTX Complete\n");                     //tx
        GENERAtbl gen1 = new GENERAtbl(1);                       //gn
        //System.out.print("\nGN Complete\n");                     //gn
        DEPOtbl depo11 = new DEPOtbl(0);                         //dp
        //System.out.println("\nDP Complete\n");                   //dp

        //System.out.println("***Step 5: POA 3D");
        DateRange dateRange = new DateRange();
        String f = dateRange.threeDayBack();
        String t = dateRange.yesterday();
        BCAnalysis bcAnalysis = new BCAnalysis(f, t);
        //System.out.print("bc done\t");
        CLAnalysis clAnalysis = new CLAnalysis(f, t);
        //System.out.print("cl done\t");
        HFAnalysis hfAnalysis = new HFAnalysis(f, t);
        //System.out.print("hf done\t");
        LTAnalysis ltAnalysis = new LTAnalysis(f, t);
        //System.out.print("lt done\t");
        MRAnalysis mrAnalysis = new MRAnalysis(f, t);
        //System.out.print("mr done\t");
        OTAnalysis otAnalysis = new OTAnalysis(f, t);
        //System.out.println("ot done");


        //System.out.println("**Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)");
        VendorCostUpd  upd2a  = new VendorCostUpd("HF",1);
        VendorCostUpd  upd1a  = new VendorCostUpd("OT",1);
        VendorCostUpd  upd3a  = new VendorCostUpd("BC",1);
        VendorCostUpd  upd4a  = new VendorCostUpd("CL",1);
        VendorCostUpd  upd5a  = new VendorCostUpd("MR",1);
        VendorCostUpd  upd6a  = new VendorCostUpd("LTLI",1);
        VendorCostUpd  upd7a  = new VendorCostUpd("LTBK",1);

        String timeReport = "Process took :"+timerSql.gettTime();
        //System.out.println(timeReport);

    }
//    }
    public static void batchCarryOverCost(){        //POA with carry over cost
        timerSql timerSql = new timerSql();
        timerSql.setbTime();

        // reset tblinventory CAPA based on PART# Q and not QQ
        UpdCapa updCapa = new UpdCapa();

        //System.out.println("***Step 0: process Vendor Cost Update");
        VendorCostPreProcess vc = new VendorCostPreProcess("DP",4);   //update Vendor Cost sheet receives from mail. _costdepo1-4 adds CAPA and PARTSLINK field and isolates.
        VendorCostPreProcess vc1 = new VendorCostPreProcess("TW",6); //delete [oe#] from vendor cost / change CAPA datatype
        VendorCostPreProcess vc2 = new VendorCostPreProcess("YCC",1); //update YCC package cuft with piece cuft
        VendorCostPreProcess vc3 = new VendorCostPreProcess("GN",1); //update GN with -9 in part# as CAPA
        //        //Updatate PL from 6 Cats to TblInventory
        //System.out.println("\n***Step 1: Updatate PL# from 6 Cats to TblInventory");
        UpdateTblinventoryPLfrom6Cats updateTblinventoryPLfrom6Cats = new UpdateTblinventoryPLfrom6Cats();
////
        //***Step 1. tblInventory to ??MAST  (i.e.OTMAST)
        //System.out.println("\n***Step 2: Insert new item from tblInventory to ??MAST  (i.e.OTMAST)\n");
        InsertNewItemInTblinventoryTo6Mast insertNewItemInTblinventoryTo6Mast = new InsertNewItemInTblinventoryTo6Mast();
////                break;
////            case 2: System.out.println("***Step 2");
//

//
        //***Step 2. Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST)
//                System.out.println("\n***Step 2.5: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST)");
//                AP ap= new AP();
//                System.out.print("AP Complete");
//                YCC ycc= new YCC();
//                System.out.print(" . YCC Complete");
//                TYGtw tyGtw = new TYGtw();
//                System.out.print(" . TW Complete");
//                TYGtx tyGtx = new TYGtx();
//                System.out.print(" . TX Complete");
//                GENERA gen = new GENERA();
//                System.out.print(" . GN Complete");
//                DEPO depo1 = new DEPO();
//                System.out.println(" . DP Complete");



        //***Step 3. Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)
        //System.out.println("\n***Step 3: Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)");
        Trn6Category trn6Category = new Trn6Category();

//        System.out.println("***Step 2.5: delete all pricing in TBLN & TBLN_TEMPOUT");      //************************** DELETE PRICING BEFORE UPDATE NEW PRICING **************************
//        delTblnCost delTblnCost = new delTblnCost();

        //System.out.println("***Step 3.6: reset tblinventory CAPA based on PART# Q and not QQ");
        // reset tblinventory CAPA based on PART# Q and not QQ
        UpdCapa updCapa1 = new UpdCapa();


        //***Step 4. Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.)  //0 = partlink ; 1 = part#
        //System.out.println("\n***Step 4: Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.");
        APtbl ap1= new APtbl(0);                                 //ap
        //System.out.print("\nAP Complete\n");                     //ap
        YCCtbl ycc1= new YCCtbl(0);                              //ycc
        //System.out.print("\nYCC Complete\n");                    //ycc
        TYGtwtbl tyGtw0 = new TYGtwtbl(0);                       //tyg
        TYGtwtbl tyGtw1 = new TYGtwtbl(1);                       //tyg  1
        //System.out.print("\nTW Complete\n");                     //tyg
        TYGtxtbl tyGtx0 = new TYGtxtbl(0);                       //tx
        TYGtxtbl tyGtx1 = new TYGtxtbl(1);                       //tx   1
        //System.out.print("\nTX Complete\n");                     //tx
        GENERAtbl gen1 = new GENERAtbl(1);                       //gn
        //System.out.print("\nGN Complete\n");                     //gn
        DEPOtbl depo11 = new DEPOtbl(0);                         //dp
        //System.out.println("\nDP Complete\n");                   //dp

        //System.out.println("***Step 5: POA 3D");
        DateRange dateRange = new DateRange();
        String f = dateRange.threeDayBack();
        String t = dateRange.yesterday();
        BCAnalysis bcAnalysis = new BCAnalysis(f, t);
        //System.out.print("bc done\t");
        CLAnalysis clAnalysis = new CLAnalysis(f, t);
        //System.out.print("cl done\t");
        HFAnalysis hfAnalysis = new HFAnalysis(f, t);
        //System.out.print("hf done\t");
        LTAnalysis ltAnalysis = new LTAnalysis(f, t);
        //System.out.print("lt done\t");
        MRAnalysis mrAnalysis = new MRAnalysis(f, t);
        //System.out.print("mr done\t");
        OTAnalysis otAnalysis = new OTAnalysis(f, t);
        //System.out.println("ot done");


        //System.out.println("**Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)");
        VendorCostUpd  upd2a  = new VendorCostUpd("HF",1);
        VendorCostUpd  upd1a  = new VendorCostUpd("OT",1);
        VendorCostUpd  upd3a  = new VendorCostUpd("BC",1);
        VendorCostUpd  upd4a  = new VendorCostUpd("CL",1);
        VendorCostUpd  upd5a  = new VendorCostUpd("MR",1);
        VendorCostUpd  upd6a  = new VendorCostUpd("LTLI",1);
        VendorCostUpd  upd7a  = new VendorCostUpd("LTBK",1);

        String timeReport = "Process took :"+timerSql.gettTime();
        //System.out.println(timeReport);

    }

    public static void step0(){ //System.out.println("***Step 0: process Vendor Cost Update");
    //System.out.println("***Step 0: process Vendor Cost Update");
    VendorCostPreProcess vc = new VendorCostPreProcess("DP",4);   //update Vendor Cost sheet receives from mail. _costdepo1-4 adds CAPA and PARTSLINK field and isolates.
    VendorCostPreProcess vc1 = new VendorCostPreProcess("TW",6); //delete [oe#] from vendor cost / change CAPA datatype   /update package cuft with piece cuft
    VendorCostPreProcess vc2 = new VendorCostPreProcess("YCC",1); //update YCC package cuft with piece cuft
    VendorCostPreProcess vc3 = new VendorCostPreProcess("GN",1); //update GN with -9 in part# as CAPA
    }
    //        //Updatate PL from 6 Cats to TblInventory
    public static void step1(){ //System.out.println("\n***Step 1: Updatate PL# from 6 Cats to TblInventory");
    //System.out.println("\n***Step 1: CLEAN UP PL & Updatate PL# from 6 TBL??N , and  TblInventory");
        UpdInvPL updInvPL = new UpdInvPL();
        UpdateTblinventoryPLfrom6Cats updateTblinventoryPLfrom6Cats = new UpdateTblinventoryPLfrom6Cats();
    }

    public static void step2(){ //System.out.println("\n***Step 2: Insert new item from tblInventory to ??MAST  (i.e.OTMAST)\n");
    //System.out.println("\n***Step 2: Insert new item from tblInventory to ??MAST  (i.e.OTMAST)\n");
    InsertNewItemInTblinventoryTo6Mast insertNewItemInTblinventoryTo6Mast = new InsertNewItemInTblinventoryTo6Mast();
    }
    public static void step2_5(){ //System.out.println("\n***Step 2.5: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST)");

//    ***Step 2. Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST)
                //System.out.println("\n***Step 2.5: Update Vendor goods information based on partslink#(Price,Part#,Package etc) to ??MAST   (i.e.OTMAST)");
                AP ap= new AP();
                //System.out.print("AP Complete");
                YCC ycc= new YCC();
                //System.out.print(" . YCC Complete");
                TYGtw tyGtw = new TYGtw();
                //System.out.print(" . TW Complete");
                TYGtx tyGtx = new TYGtx();
                //System.out.print(" . TX Complete");
                GENERA gen = new GENERA();
                //System.out.print(" . GN Complete");
                DEPO depo1 = new DEPO();
                //System.out.println(" . DP Complete");

    }
    public static void step3(){ //System.out.println("\n***Step 3: Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)");

    //***Step 3. Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)
    //System.out.println("\n***Step 3: Transfer ??MAST to TBL??N (ie. OTMAST to TBLOTN)");
    Trn6Category trn6Category = new Trn6Category();
    //need to divide all UA exisitng cuft /pkg for TYGTW ONLY!!! ********************************************
    }
    public static void step3_5(){ //    System.out.println("***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT");      //************************** DELETE PRICING BEFORE UPDATE NEW PRICING **************************

    //System.out.println("***Step 3.5: delete all pricing in TBLN & TBLN_TEMPOUT");      //************************** DELETE PRICING BEFORE UPDATE NEW PRICING **************************
    delTblnCost delTblnCost = new delTblnCost();
    }

    public static void step3_6(){ //    System.out.println("***Step 3.6: reset tblinventory CAPA based on PART# Q and not QQ");

    //System.out.println("***Step 3.6: reset tblinventory CAPA based on PART# Q and not QQ / Cleanup TBLINV PL#");
    // reset tblinventory CAPA based on PART# Q and not QQ
    UpdCapa updCapa = new UpdCapa();
//    UpdInvPL updInvPL = new UpdInvPL();

    }
    public static void step4Newonly(){ //System.out.println("\n***Step 4: Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.");
    //***Step 4. Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.)  //0 = partlink ; 1 = part#
        //Genera must use PART# since there's no CAPA field at source
    //System.out.println("\n***Step 4: Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.");
    APtbl ap1= new APtbl(0);                                 //ap
    //System.out.print("\nAP Complete\n");                     //ap
    YCCtbl ycc1= new YCCtbl(0);                              //ycc
    //System.out.print("\nYCC Complete\n");                    //ycc
    TYGtwtbl tyGtw0 = new TYGtwtbl(0);                       //tyg
//    TYGtwtbl tyGtw1 = new TYGtwtbl(1);                       //tyg  1
    //System.out.print("\nTW Complete\n");                     //tyg
    TYGtxtbl tyGtx0 = new TYGtxtbl(0);                       //tx
//    TYGtxtbl tyGtx1 = new TYGtxtbl(1);                       //tx   1
    //System.out.print("\nTX Complete\n");                     //tx
    GENERAtbl gen1 = new GENERAtbl(0);                       //gn
    //System.out.print("\nGN Complete\n");                     //gn
    DEPOtbl depo11 = new DEPOtbl(0);                         //dp
    //System.out.println("\nDP Complete\n");                   //dp

    }
    public static void step4IncOrg(){ ////System.out.println("\n***Step 4: Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.");



        //***Step 4. Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.)  //0 = partlink ; 1 = part#
        //Genera must use PART# since there's no CAPA field at source
        //System.out.println("\n***Step 4: Update TBL??N item info with Vendor's data. (price, otem#,ven#,cuft etc.");
        APtbl ap1= new APtbl(0);                                 //ap
        //System.out.print("\nAP Complete\n");                     //ap
        YCCtbl ycc1= new YCCtbl(0);                              //ycc
        //System.out.print("\nYCC Complete\n");                    //ycc
        TYGtwtbl tyGtw0 = new TYGtwtbl(0);                       //tyg
        TYGtwtbl tyGtw1 = new TYGtwtbl(1);                       //tyg  1
        //System.out.print("\nTW Complete\n");                     //tyg
        TYGtxtbl tyGtx0 = new TYGtxtbl(0);                       //tx
        TYGtxtbl tyGtx1 = new TYGtxtbl(1);                       //tx   1
        //System.out.print("\nTX Complete\n");                     //tx
        GENERAtbl gen1 = new GENERAtbl(1);                       //gn
        //System.out.print("\nGN Complete\n");                     //gn
        DEPOtbl depo11 = new DEPOtbl(0);                         //dp
        //System.out.println("\nDP Complete\n");                   //dp
    }

    public static void step5(){ ////System.out.println("***Step 5: POA 3D");

    //System.out.println("***Step 5: POA 3D");
    DateRange dateRange = new DateRange();
    String f = dateRange.threeDayBack();
    String t = dateRange.yesterday();
    BCAnalysis bcAnalysis = new BCAnalysis(f, t);
    //System.out.print("bc done\t");
    CLAnalysis clAnalysis = new CLAnalysis(f, t);
    //System.out.print("cl done\t");
    HFAnalysis hfAnalysis = new HFAnalysis(f, t);
    //System.out.print("hf done\t");
    LTAnalysis ltAnalysis = new LTAnalysis(f, t);
    //System.out.print("lt done\t");
    MRAnalysis mrAnalysis = new MRAnalysis(f, t);
    //System.out.print("mr done\t");
    OTAnalysis otAnalysis = new OTAnalysis(f, t);
    //System.out.println("ot done");

    }
    public static void step6(){ ////System.out.println("**Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#)");



    //System.out.println("***Step 6:NEW UPDATE PRICE BY PART#  (This should be by default since all items has DNK part#) ");
    VendorCostUpd  upd2a  = new VendorCostUpd("HF",1);
    VendorCostUpd  upd1a  = new VendorCostUpd("OT",1);
    VendorCostUpd  upd3a  = new VendorCostUpd("BC",1);
    VendorCostUpd  upd4a  = new VendorCostUpd("CL",1);
    VendorCostUpd  upd5a  = new VendorCostUpd("MR",1);
    VendorCostUpd  upd6a  = new VendorCostUpd("LTLI",1);
    VendorCostUpd  upd7a  = new VendorCostUpd("LTBK",1);

    }

//    public static void step6_1(){
        //replace all CUFT for TYGTW VENDOR ONLY. CUFT/PKG in all 6 CATS
//        TYGcuftPkgUpdate tyGcuftPkgUpdate = new TYGcuftPkgUpdate();
//    }
    public static void step7(){           //cleanup tempout by rename vendor column for AP and YCC. export and mail POA
        //Not working yet.
//        ExecuteExportPO executeExportPO = new ExecuteExportPO();
//        EmailAttachment emailAttachment = new EmailAttachment();
//        Cleanup cleanup = new Cleanup();
        updTEMPUOUT2VenColumn updTEMPUOUT2VenColumn = new updTEMPUOUT2VenColumn("BC");
        updTEMPUOUT2VenColumn updTEMPUOUT2VenColumn1 = new updTEMPUOUT2VenColumn("OT");
        updTEMPUOUT2VenColumn updTEMPUOUT2VenColumn2 = new updTEMPUOUT2VenColumn("HF");
        //run procpo.jar
        ExecutePOAnalysis executePOAnalysis = new ExecutePOAnalysis();

//        Mailer procPO = new Mailer();
    }


}

